
<div class="header">
    <b>离职列表<?php if($params['fid']):?>-<?=$fun_list[$params['fid']]['function_name']?><?php endif;?></b>
</div>
    <div class="body">
        <div class="search">
            <form action="" method="post">
            <input type="hidden" name="fid" value="<?=$params['fid']?>">
            <input type="hidden" class="start" name="vstart" value="<?=$params['start']?>">
            <input type="hidden" class="end" name="vend" value="<?=$params['end']?>">
            <input class="date" readonly="true" name="start" value="<?=date('Y-m-d',strtotime($params['start']))?>" />至<input class="date" readonly="true" name="end" value="<?=date('Y-m-d',strtotime($params['end']))?>"/><input type="submit" value="查询"/>
            </form>
        </div>
        <?php if(!$params['fid']):?>
        <table cellpadding="0" cellspacing="0">
            <thead>
                <tr>
                    <th colspan="4"></th>
                    <th colspan="2" style="text-align: left;padding-left: 20px;">职级</th>
                    <th colspan="7" style="text-align: left;padding-left: 20px;">在职时间</th>
                </tr>
                <tr>
                    <th>统计</th>
                    <th>离职率</th>
                    <th>主动离职</th>
                    <th>被动离职</th>
                    <th>M4／P7以下</th>
                    <th>M4／P7以上</th>
                    <th>3个月以内</th>
                    <th>3－6个月</th>
                    <th>0.5-1年</th>
                    <th>1－1.5年</th>
                    <th>1.5年－2年</th>
                    <th>2年以上</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
            <?php if(!empty($data['datalist'])):?>
            <?php
            $all = $data['datalist'][999]['on_job_num']+$data['datalist'][999]['enter_num'];
            $dim = $data['datalist'][999]['dimission_num'];
            ?>
                <tr class="fst">
                    <td>安居客集团</td>
                    <td><?=floor(($dim/$all)*10000)/10000*100?>%</td>
                    <td><?=$data['datalist'][999]['leave_type_1']?></td>
                    <td><?=$data['datalist'][999]['leave_type_2']?></td>
                    <td><?=$data['datalist'][999]['pm_1']?></td>
                    <td><?=$data['datalist'][999]['pm_2']?></td>
                    <td><?=$data['datalist'][999]['job_time_1']?></td>
                    <td><?=$data['datalist'][999]['job_time_2']?></td>
                    <td><?=$data['datalist'][999]['job_time_3']?></td>
                    <td><?=$data['datalist'][999]['job_time_4']?></td>
                    <td><?=$data['datalist'][999]['job_time_5']?></td>
                    <td><?=$data['datalist'][999]['job_time_6']?></td>
                    <td></td>
                </tr>
                <?php unset($data['datalist'][999]); foreach($data['datalist'] as $k=>$val):?>
                <tr>
                    <td st="<?=$k?>"><?=$fun_list[$k]['function_name']?></td>
                    <td><?=floor(($val['dimission_num']/($val['enter_num']+$val['on_job_num']))*10000)/10000*100?>%</td>
                    <td><a class="blueColor"> <?=$val['leave_type_1']?></a></td>
                    <td><a class="blueColor"> <?=$val['leave_type_2']?></a></td>
                    <td><?=$val['pm_1']?></td>
                    <td><?=$val['pm_2']?></td>
                    <td><?=$val['job_time_1']?></td>
                    <td><?=$val['job_time_2']?></td>
                    <td><?=$val['job_time_3']?></td>
                    <td><?=$val['job_time_4']?></td>
                    <td><?=$val['job_time_5']?></td>
                    <td><?=$val['job_time_6']?></td>
                    <td>
                    <?php if($val['dimission_num']):?>
                    <a target="_blank" href="<?=Report_Urls::dimission_view_url($k,$params['start'],$params['end'],$params['type'])?>">查看详情</a>
                    <?php endif;?>
                    </td>
                </tr>
                <?php endforeach;?>
            <?php endif;?>
            </tbody>
        </table>
        <?php else:?>
        <!-- 查看部门 -->
        <table cellpadding="0" cellspacing="0">
    <thead>
    <tr>
        <th colspan="5"></th>
        <th colspan="2" style="text-align: left;padding-left: 20px;">职级</th>
        <th colspan="7" style="text-align: left;padding-left: 20px;">在职时间</th>
    </tr>
    <tr>
        <th colspan="2">统计</th>
        <th>离职率</th>
        <th>主动离职</th>
        <th>被动离职</th>
        <th>M4／P7以下</th>
        <th>M4／P7以上</th>
        <th>3个月以内</th>
        <th>3－6个月</th>
        <th>0.5-1年</th>
        <th>1－1.5年</th>
        <th>1.5年－2年</th>
        <th>2年以上</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php if(!empty($data['datalist'])):?>
    <?php
            $all = $data['datalist'][999]['on_job_num']+$data['datalist'][999]['enter_num'];
            $dim = $data['datalist'][999]['dimission_num'];
            ?>
    <tr class="fst">
        <td colspan="2"><?=$fun_list[$params['fid']]['function_name']?></td>
        <td><?=floor(($dim/$all)*10000)/10000*100?>%</td>
        <td><?=$data['datalist'][999]['leave_type_1']?></td>
        <td><?=$data['datalist'][999]['leave_type_2']?></td>
        <td><?=$data['datalist'][999]['pm_1']?></td>
        <td><?=$data['datalist'][999]['pm_2']?></td>
        <td><?=$data['datalist'][999]['job_time_1']?></td>
        <td><?=$data['datalist'][999]['job_time_2']?></td>
        <td><?=$data['datalist'][999]['job_time_3']?></td>
        <td><?=$data['datalist'][999]['job_time_4']?></td>
        <td><?=$data['datalist'][999]['job_time_5']?></td>
        <td><?=$data['datalist'][999]['job_time_6']?></td>
        <td>&nbsp;</td>
    </tr>
    <?php unset($data['datalist'][999]); foreach($data['datalist'] as $k=>$val):?>
     <tr>
        <td class="indentTD">&nbsp;</td>
        <td bu="<?=$k?>" style="width: 100px;" class="department"><label style="padding-right: 13px;"><?=$bu_list[$k]['bu_name']?></label></td>
        <td><?=floor(($val['dimission_num']/($val['enter_num']+$val['on_job_num']))*10000)/10000*100?>%</td>
        <td><a class="blueColor"> <?=$val['leave_type_1']?></a></td>
        <td><a class="blueColor"> <?=$val['leave_type_2']?></a></td>
        <td><?=$val['pm_1']?></td>
        <td><?=$val['pm_2']?></td>
        <td><?=$val['job_time_1']?></td>
        <td><?=$val['job_time_2']?></td>
        <td><?=$val['job_time_3']?></td>
        <td><?=$val['job_time_4']?></td>
        <td><?=$val['job_time_5']?></td>
        <td><?=$val['job_time_6']?></td>
        <td style="width: 130px;">
        <?php if($val['dimission_num']):?>
        <?php if(!empty($val['city_list']) && count($val['city_list'])==1):?>
        <?php $cit = array_keys($val['city_list']); $city_id=$cit[0];?>
        <?php if(!empty($val['dep_ids']) && in_array($val['dep_ids'][0],$allow_depids)):?>
        <a href="<?=Report_Urls::dimission_view_detail($val['dep_ids'][0],$params['start'],$params['end'],$params['fid'],$k,$city_id)?>" fid="<?=$params['fid']?>" bu_id="<?=$k?>">查看详情</a>
        <?php endif;?>
        <?php else:?>
        <a href="#" target="_blank" class="detail" v="1012" fid="<?=$params['fid']?>" bu_id="<?=$k?>" onclick="return false">查看详情</a>
        <?php endif;?>
        <?php endif;?>
        </td>
    </tr>
    <?php endforeach;?>
    <?php endif;?>
    <!--<tr>-->
        <!--<td class="indentTD">&nbsp;</td>-->
        <!--<td class="city">上海</td>-->
        <!--<td>12%</td>-->
        <!--<td><a class="blueColor" href="#"> 120</a></td>-->
        <!--<td><a class="blueColor" href="#"> 120</a></td>-->
        <!--<td>120</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td><a href="#" onclick="return false">查看详情</a></td>-->
    <!--</tr>-->
    <!--<tr>-->
        <!--<td class="indentTD">&nbsp;</td>-->
        <!--<td class="city">上海</td>-->
        <!--<td>12%</td>-->
        <!--<td><a class="blueColor" href="#"> 120</a></td>-->
        <!--<td><a class="blueColor" href="#"> 120</a></td>-->
        <!--<td>120</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td><a href="#" onclick="return false">查看详情</a></td>-->
    <!--</tr>-->
    <!--<tr>-->
        <!--<td class="indentTD">&nbsp;</td>-->
        <!--<td class="city">上海</td>-->
        <!--<td>12%</td>-->
        <!--<td><a class="blueColor" href="#"> 120</a></td>-->
        <!--<td><a class="blueColor" href="#"> 120</a></td>-->
        <!--<td>120</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td><a href="#" onclick="return false">查看详情</a></td>-->
    <!--</tr>-->
    <!--<tr>-->
        <!--<td class="indentTD">&nbsp;</td>-->
        <!--<td class="city">上海</td>-->
        <!--<td>12%</td>-->
        <!--<td><a class="blueColor" href="#"> 120</a></td>-->
        <!--<td><a class="blueColor" href="#"> 120</a></td>-->
        <!--<td>120</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td>12%</td>-->
        <!--<td><a href="#" onclick="return false">查看详情</a></td>-->
    <!--</tr>-->
    </tbody>
</table>

        <?php endif;?>
    </div>
    <div class="footer">
    </div>
    <?php $this->script_block_begin(); ?>
<script type="text/javascript">
var url_dep_list = "<?php echo Report_Urls::ajax_dep_list();?>";
</script>
<?php $this->script_block_end(); ?>